package lxs.allvolc;

import java.security.PublicKey;

import mars.appwidget02.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

public class MainActivity extends Activity {
	public RadioGroup mrg;
	public RadioButton mradio0,mradio1,mradio2,mradio3,mradio4;
	public TextView tv1;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        tv();
       mrg.setOnCheckedChangeListener(mChangeRadio);
    }
    private RadioGroup.OnCheckedChangeListener mChangeRadio =
        new RadioGroup.OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				// TODO Auto-generated method stub
			if (checkedId==mradio0.getId()){
				tv1.setText(mradio0.getText());
			}else if(checkedId==mradio1.getId()){
				tv1.setText(mradio1.getText());
			}else if(checkedId==mradio2.getId()){
				tv1.setText(mradio2.getText());
			}else if(checkedId==mradio3.getId()){
				tv1.setText(mradio3.getText());
			}else if(checkedId==mradio4.getId()){
				tv1.setText(mradio4.getText());
			}
			}
    	
    };
    public void tv() {
		// TODO Auto-generated method stub
	mradio0=(RadioButton)findViewById(R.id.radio0);
	mradio1=(RadioButton)findViewById(R.id.radio1);
	mradio2=(RadioButton)findViewById(R.id.radio2);
	mradio3=(RadioButton)findViewById(R.id.radio3);
	mradio4=(RadioButton)findViewById(R.id.radio4);
	mrg=(RadioGroup)findViewById(R.id.radioGroup1);
	tv1=(TextView)findViewById(R.id.textView1);
	}

}